<!--
  描述：离职信息表详情页
  @author tanghongjun
  @since 2020-05-14 10:48:18
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>新增或编辑分类</title>
</head>
<style>
    .layui-form-required:before {
        content: "*\00A0\00A0";
        display: inline-flex;
        color: #ff0000;
    }
</style>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">组织关系&nbsp;&nbsp;>
        <a th:lay-href="|${SYS_MCC}/staff/list.action|">员工管理</a>&nbsp;&nbsp;>&nbsp;
        <zmn th:text="${obj.staffName}"></zmn>&nbsp;&nbsp;>&nbsp;
        <zmn th:text="${(staffLeaveOffice.leaveId > 0) ? '修改离职信息' : '新增离职信息'}"></zmn>
    </blockquote>

    <div class="layui-card" th:with="hasDetail=${#authPermit.checkPermit('/staff/detail.action')},
     hasList=${#authPermit.checkPermit('/staff/list.action')},
     hasAddEdit=${#authPermit.checkPermit('/staff/modify/addEdit.action')},
     hasArchives=${#authPermit.checkPermit('/staff/staffarchives/addEditView.action')},
     hasContract=${#authPermit.checkPermit('/staff/staffcontract/addEditView.action')},
     hasFamily=${#authPermit.checkPermit('/staff/stafffamily/listByStaffId.action')},
     hasLeaveoffice=${#authPermit.checkPermit('/staff/staffleaveoffice/addEditView.action')},
     hasPerformance=${#authPermit.checkPermit('/staff/staffperformance/listByStaffId.action')},
     hasChangelog=${#authPermit.checkPermit('/staff/staffchangelog/list.action')},
     hasStaffRoleList=${#authPermit.checkPermit('/staff/role/list.action')},
     hasDpermitOrganizeList=${#authPermit.checkPermit('/staff/dpermit/organize/tree.action')}">
        <div th:if="${staffLeaveOffice.leaveId > 0}">
            <div th:replace="staff/_tab::tab"></div>
        </div>

        <form method="post" action="" class="layui-form" lay-filter="zmn-form">

            <input type="hidden" name="leaveId" th:value="${staffLeaveOffice.leaveId}"/>
            <input type="hidden" name="staffId" th:value="${staffLeaveOffice.staffId}"/>

            <div class="layui-card-header" style="margin-top:10px;"><b>基本信息</b></div>
            <div class="layui-split">&nbsp;</div>

            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">离职状态：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <select name="status" id="status" lay-filter="status" lay-search>
                            <option th:each="item:${leaveStatusList}" th:value="${item.key}"
                                    th:selected="${item.key == staffLeaveOffice.status}"
                                    th:text="${item.value}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">离职原因：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <select name="leaveReason" id="leaveReason" lay-filter="leaveReason" lay-search>
                            <option value="">-选择-</option>
                            <option th:each="item:${leaveReasonList}" th:value="${item.key}"
                                    th:selected="${item.key == staffLeaveOffice.leaveReason}"
                                    th:text="${item.value}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">离职交接人：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <select name="leaveSuccessor" id="leaveSuccessor" lay-filter="leaveSuccessor" lay-search>
                            <option value="">-选择-</option>
                            <option th:each="item:${staffList}" th:value="${item.value+'-'+item.text}"
                                    th:selected="${item.value+'-'+item.text == staffLeaveOffice.leaveSuccessor}"
                                    th:text="${item.value+'-'+item.text}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">最后工作时间：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <input type="text" id="lastWorkTime" name="lastWorkTime" lay-verify="required" lay-verType="tips"
                               th:value="${staffLeaveOffice.lastWorkTime}" placeholder="最后工作时间"
                               autocomplete="off" class="layui-input" maxlength="100"/>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">离职扫描件：</label>

                <div id="files">
                    <div th:if="${staffLeaveOffice.leaveFileSrc != null && staffLeaveOffice.leaveFileSrc != ''}"
                         id="file">
                        <div class="layui-input-block">
                            <div class="layui-input-inline" style="width: auto">
                                <span name="fileSrc" id="fileSrc" th:key="${staffLeaveOffice.leaveFileName}"
                                      th:text="${staffLeaveOffice.leaveFileName}"
                                      th:href="${staffLeaveOffice.leaveFileSrc}" class="layui-form-label uploadFile"
                                      style="width: auto;" download="">我是文件名</span>
                                <span th:value="${staffLeaveOffice.leaveFileSize}" id="fileSize"
                                      class="layui-form-label"
                                      th:text="${#numbers.formatDecimal(staffLeaveOffice.leaveFileSize*1.0/1024, 1, 2)+'KB'}"
                                      style="width: auto; color: #9F9F9F;">16.66KB</span>
                                <a class="layui-form-label" th:onclick="|deleteFile('fileSrc')|"
                                   style="width:auto;color: #00a0e9;cursor:pointer">
                                    删除
                                </a>
                                <a class="layui-form-label"
                                   th:onclick="downLoadFile([[${staffLeaveOffice.leaveFileSrc}]])"
                                   style="width:auto;color: #00a0e9;cursor:pointer">
                                    下载
                                </a>
                            </div>
                        </div>
                        <div class="layui-split">&nbsp;</div>
                    </div>

                    <div th:if="${staffLeaveOffice.leaveFileSrc2 != null && staffLeaveOffice.leaveFileSrc2 != ''}"
                         id="file">
                        <div class="layui-input-block">
                            <div class="layui-input-inline" style="width: auto">
                                <span name="fileSrc2" id="fileSrc2" th:key="${staffLeaveOffice.leaveFileName2}"
                                      th:text="${staffLeaveOffice.leaveFileName2}"
                                      th:href="${staffLeaveOffice.leaveFileSrc2}" class="layui-form-label uploadFile"
                                      style="width: auto;" download="">我是文件名</span>
                                <span th:value="${staffLeaveOffice.leaveFileSize2}" id="fileSize2"
                                      class="layui-form-label"
                                      th:text="${#numbers.formatDecimal(staffLeaveOffice.leaveFileSize2*1.0/1024, 1, 2)+'KB'}"
                                      style="width: auto; color: #9F9F9F;">16.66KB</span>
                                <a class="layui-form-label" th:onclick="|deleteFile('fileSrc2')|"
                                   style="width:auto;color: #00a0e9;cursor:pointer">
                                    删除
                                </a>
                                <a class="layui-form-label"
                                   th:onclick="downLoadFile([[${staffLeaveOffice.leaveFileSrc2}]])"
                                   style="width:auto;color: #00a0e9;cursor:pointer">
                                    下载
                                </a>
                            </div>
                        </div>
                        <div class="layui-split">&nbsp;</div>
                    </div>

                    <div th:if="${staffLeaveOffice.leaveFileSrc3 != null && staffLeaveOffice.leaveFileSrc3 != ''}"
                         id="file">
                        <div class="layui-input-block">
                            <div class="layui-input-inline" style="width: auto">
                                <span name="fileSrc3" id="fileSrc3" th:key="${staffLeaveOffice.leaveFileName3}"
                                      th:text="${staffLeaveOffice.leaveFileName3}"
                                      th:href="${staffLeaveOffice.leaveFileSrc3}" class="layui-form-label uploadFile"
                                      style="width: auto;" download="">我是文件名</span>
                                <span th:value="${staffLeaveOffice.leaveFileSize3}" id="fileSize3"
                                      class="layui-form-label"
                                      th:text="${#numbers.formatDecimal(staffLeaveOffice.leaveFileSize3*1.0/1024, 1, 2)+'KB'}"
                                      style="width: auto; color: #9F9F9F;">16.66KB</span>
                                <a class="layui-form-label" th:onclick="|deleteFile('fileSrc3')|"
                                   style="width:auto;color: #00a0e9;cursor:pointer">
                                    删除
                                </a>
                                <a class="layui-form-label"
                                   th:onclick="downLoadFile([[${staffLeaveOffice.leaveFileSrc3}]])"
                                   style="width:auto;color: #00a0e9;cursor:pointer">
                                    下载
                                </a>
                            </div>
                        </div>
                        <div class="layui-split">&nbsp;</div>
                    </div>
                </div>

                <div class="layui-input-block">
                    <div class="layui-input-inline">
                        <a href="javascript:void(0)" id="upload" style="color: #00a0e9">
                            &nbsp;&nbsp;&nbsp;&nbsp;+添加文件
                        </a>
                        <span style="color: #9F9F9F;">(不超过25M)</span>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">备注：</label>
                <div class="layui-input-block">
                    <div class="layui-input-inline" style="width: 600px">
                         <textarea placeholder="备注" maxlength="100" th:text="${staffLeaveOffice.remark}"
                                   id="remark" name="remark"
                                   class="layui-textarea"></textarea>
                    </div>
                </div>
            </div>

            <zmn th:if="${staffLeaveOffice.leaveId > 0}">
                <div class="layui-card-header"><b>其他信息</b></div>
                <div class="layui-split">&nbsp;</div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">修改人/时间：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${staffLeaveOffice.updater} + '&nbsp;/&nbsp;' + ${#dates.format(staffLeaveOffice.updateTime, 'yyyy-MM-dd HH:mm:ss')}">
                            修改人/时间
                        </div>
                    </div>
                </div>
                <div class="layui-form-item layui-form-item-xs">
                    <label class="layui-form-label">创建人/时间：</label>
                    <div class="layui-input-block">
                        <div class="layui-form-mid layui-word-aux"
                             th:text="${staffLeaveOffice.creater} + '&nbsp;/&nbsp;' + ${#dates.format(staffLeaveOffice.createTime, 'yyyy-MM-dd HH:mm:ss')}">
                            创建人/时间
                        </div>
                    </div>
                </div>
            </zmn>

            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin submit" id="submit_id">
                <div class="layui-input-block" th:if="${staffLeaveOffice.leaveId <= 0}">
                    <div class="layui-footer" style="left: 0;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </div>
            <div class="layui-split">&nbsp;</div>
        </form>

    </div>

</div>

<script type="text/javascript" th:inline="javascript">

    var json = {
        staffLeaveOffice: [[${staffLeaveOffice}]]
    };

    layui.config({
        base: "/static/lay/",
        version: 202010261745
    }).extend({
        index: "lib/index",
        plat_staffleaveoffice_detail: "staff/staffleaveoffice/zmn.plat.staffleaveoffice.detail",
    }).use(['index', 'plat_staffleaveoffice_detail']);

</script>
</body>
</html>